package com.ycz.sas.jgen.connection;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

public class DynamicDataSource extends AbstractRoutingDataSource{
	
	@Override
	protected Object determineCurrentLookupKey() {
		System.out.println("DynamicDataSource Type: "+LocalContextHolder.getCustomerType());
		setDefaultTargetDataSource(LocalContextHolder.getCustomerType());
		return LocalContextHolder.getCustomerType();
	}

}
